//
//  BaseNormalController.m
//  fintech_prod
//
//  Created by 小崔 on 2020/2/7.
//  Copyright © 2020 小崔. All rights reserved.
//

#import "BaseTitleController.h"

NSString * const ZSHDidUploadCardNotification = @"com.zsh.idCar.upload"; // 上传身份证通知

@interface BaseTitleController ()

@end

@implementation BaseTitleController

- (void)viewWillAppear:(BOOL)animated{
    [self.navigationController setNavigationBarHidden:YES];
}

#pragma mark - Lifecycle
-(UIStatusBarStyle)preferredStatusBarStyle {
    return UIStatusBarStyleLightContent;
}

- (void)viewDidLoad {
    [super viewDidLoad];
    [self setUpTitleView];
    [self addControllers];
    // Do any additional setup after loading the view.
}

- (id)initWithTitle:(NSString *)title{
    if ([super init]) {
        self.titleView.titleLab.text = title;
    }
    return self;
}

- (void)setUpTitleView{
    self.view.backgroundColor = [UIColor whiteColor];
    [self.view addSubview:self.titleView];
    WEAKSELF
    [self.titleView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(weakSelf.view.mas_left);
        make.top.equalTo(weakSelf.view.mas_top);
        make.right.equalTo(weakSelf.view.mas_right);
    }];
}
-(void)addControllers{
    
}
- (void)handleClickReturnButtonAction:(UIButton *)sender{
    [self.navigationController popViewControllerAnimated:YES];
}

- (void)back{
    [self.navigationController popViewControllerAnimated:YES];
}


- (BaseTitleView *)titleView{
    if (!_titleView) {
        self.titleView = [[BaseTitleView alloc] init];
        [_titleView.returnBtn addTarget:self action:@selector(handleClickReturnButtonAction:) forControlEvents:UIControlEventTouchUpInside];
    }
    return _titleView;
}


/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
